package com.xpu.stock.mapper;

import com.xpu.stock.common.domain.Stock4EvrDayDomain;
import com.xpu.stock.common.domain.Stock4MinuteDomain;
import com.xpu.stock.common.domain.StockUpdownDomain;
import com.xpu.stock.pojo.StockRtInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author 谢丽华
* @description 针对表【stock_rt_info(个股详情信息表)】的数据库操作Mapper
* @createDate 2022-08-01 22:55:22
* @Entity com.xpu.stock.pojo.StockRtInfo
*/
@Mapper
public interface StockRtInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockRtInfo record);

    int insertSelective(StockRtInfo record);

    StockRtInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockRtInfo record);

    int updateByPrimaryKey(StockRtInfo record);

    List<StockUpdownDomain> getStockRtInfoLimit(@Param("timePoint") Date timePoint);

    List<StockUpdownDomain> getStockInfo4All();

    List<Map> getStockUpDownCount(@Param("startTime") Date startTime,
                                  @Param("endTime") Date endTime,
                                  @Param("flag") int flag);

    List<Map> getStockUpDownRegion(@Param("timePoint") Date timePoint);

    List<Stock4MinuteDomain> getStockInfoByCodeAndDate(@Param("stockCode") String stockCode,
                                                       @Param("startTime") Date startTime,
                                                       @Param("endTime") Date endTime);

    List<Stock4EvrDayDomain> getStockInfo4EvrDay(@Param("code") String code,
                                                 @Param("startTime") Date startTime,
                                                 @Param("endTime") Date endTime);

    /**
     * 批量插入股票实时详情信息
     * @param stockRtInfos
     */
    void insertBatch(@Param("stockRtInfos") List<StockRtInfo> stockRtInfos);
}
